/**
 * com.oceansoft.mobile.econsole.modules.weixin.service.impl.WechatH5ApiServiceImpl
 *
 * @author chenw
 * @create 16/2/4.20:22
 * @email javacspring@hotmail.com
 */

package com.oceansoft.mobile.econsole.modules.weixin.service.impl;

import com.oceansoft.mobile.econsole.modules.weixin.persistence.IWechatH5ApiMapper;
import com.oceansoft.mobile.econsole.modules.weixin.service.IWechatH5ApiService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.UUID;

/**
 * 微信页面后台接口业务逻辑组件实现
 *
 * @author chenw
 * @create 16/2/4 20:22
 * @email javacspring@gmail.com
 */
@Service
public class WechatH5ApiServiceImpl implements IWechatH5ApiService {

    @Resource
    private IWechatH5ApiMapper wechatH5ApiMapper;

    @Override
    public boolean saveComplaint(String userId, String userName, String subject, String content, int anonymous) {
        int rt = wechatH5ApiMapper.saveComplaint(new HashMap<String, Object>() {{
            put("guid", UUID.randomUUID().toString());
            put("userId", userId);
            put("userName", userName);
            put("subject", subject);
            put("content", content);
            put("anonymous", anonymous);
        }});
        return 1 == rt;
    }
}
